//  226
import BTree from "./index.js";
function invertTree(root) {
  function travel(node) {
    if (node === null) return;
    const temp = node.left;
    node.left = node.right;
    node.right = temp;
    travel(node.left);
    travel(node.right);
  }
  travel(root);
  return root;
}
const btree = new BTree([4, 2, 7, 1, 3, 6, 9]);
invertTree(btree);
console.log(1);
